package com.zhang.novel.mapper;

import com.zhang.novel.entity.Book;
import com.zhang.novel.search.BookSP;
import com.zhang.novel.vo.BookVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface FrontBookMapper extends BookMapper {

    /**
     * 按评分随机查询小说集合
     * @param limit 查询条数
     * @return 小说集合
     * */
    List<Book> selectIdsByScoreAndRandom(@Param("limit") int limit);

    /**
     * 点击量增加
     * @param bookId
     * @param visitCount
     */
    void addVisitCount(@Param("bookId") Long bookId,@Param("visitCount") Integer visitCount);

    /**
     * 增加评论数
     * @param bookId
     */
    void addCommentCount(Long bookId);

    List<BookVO> searchByPage(BookSP params);

    List<Book> queryNetworkPicBooks(@Param("localPicPrefix") String localPicPrefix,@Param("limit") Integer limit);
}
